/** 
 * File-Name:User.java
 *
 * Created on 2011-6-2 上午11:05:56
 * 
 * @author: Neo (neolimeng@gmail.com)
 * Software Engineering Institute, Peking University, China
 * 
 * Copyright (c) 2009, Peking University
 * 
 *
 */
package site.entity;

import neoutil.CommonEntity;
import neoutil.StringEncrypt;

/**
 * Description: User Information.
 * 
 * @author: Neo (neolimeng@gmail.com) Software Engineering Institute, Peking
 *          University, China
 * @version 1.0 2011-6-2 上午11:05:56
 */
public class User extends CommonEntity {
	public static int STATUS_UNACTIVATED = 0;
	public static int STATUS_ACTIVATED = 1;

	private String name;
	private String realName;
	private String email;
	private String password;
	private String reenterPassword;
	private int rid = Role.GUSET;
	private Role role;
	/**
	 * 是否实名
	 */
	private boolean real = false;
	private String address;
	private String telephone;
	private String fax;
	private String contactPerson;
	private String description;
	private int status = STATUS_UNACTIVATED;

	public String getRolename() {
		
		if(rid == Role.ADMIN)
			return "三审管理员";
		else if(rid==Role.REVIEWER)
			return "二审管理员";
		else if(rid==Role.INPUT)
			return "一审录入员";
		else
			return "普通用户";
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = StringEncrypt.encrypt(password);
	}

	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	public String getContactPerson() {
		return contactPerson;
	}

	public void setContactPerson(String contactPerson) {
		this.contactPerson = contactPerson;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getReenterPassword() {
		return reenterPassword;
	}

	public void setReenterPassword(String reenterPassword) {
		this.reenterPassword = reenterPassword;
	}

	public int getRid() {
		return rid;
	}

	public void setRid(int rid) {
		this.rid = rid;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public boolean getReal() {
		return real;
	}

	public void setReal(boolean real) {
		this.real = real;
	}
}
